home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / demos.idb / usr / demos / Demo_Interfaces / Buttonfly / buttonfly.sh.z / buttonfly.sh
Encoding:
Linux/UNIX/POSIX Shell Script  |  1997-06-26  |  1.9 KB  |  64 lines

  1. #!/bin/sh
  2. #Tag 0x9039
  3. #
  4. # Buttonfly launcher script
  5. #       
  6. # Updated Tue Jul 16 20:06:40 PDT 1996 Diana Starr
  7. # -------------------------------------------------------------
  8. # If there are some arguments, try to run buttonfly with them.
  9. # Check for audio flag first, 
  10. # If remaining args not empty then assume the remaining is a path.
  11. # Otherwise do same stuff would do if no args but add audio tag:
  12. #
  13. # Otherwise see if there are some menus in the local directory 
  14. # but if not, then run from the default buttonfly location
  15. # -------------------------------------------------------------
  16.  
  17.  
  18.   if [ $# != 0 ]
  19.     then
  20.         if [ $1 = "-a" ]
  21.         then 
  22.             shift 
  23.             if [ $1 ]
  24.             then
  25.               # Arguments included audio flag and hopefully remaining is a path 
  26.               cd $*
  27.               sh -c "/usr/demos/Demo_Interfaces/Buttonfly/buttonfly -a "
  28.  
  29.             else
  30.  
  31.               # Arguments were audio flag and no path - check for local menus 
  32.               localdir=`pwd`
  33.               localfiles=`ls $localdir/.menu`
  34.               if [ $localfiles ]
  35.               then
  36.                  sh -c "/usr/demos/Demo_Interfaces/Buttonfly/buttonfly -a "
  37.               else
  38.               # Args were audio flag but no path or local menus so run default
  39.                  cd /usr/demos/Demo_Interfaces/Buttonfly
  40.                  sh -c "/usr/demos/Demo_Interfaces/Buttonfly/buttonfly -a"
  41.               fi
  42.            fi
  43.        else 
  44.           # Argument passed to script was a path only
  45.           cd $*
  46.           sh -c "/usr/demos/Demo_Interfaces/Buttonfly/buttonfly "
  47.       fi
  48.  
  49.   else
  50.  
  51.     # No arguments passed to script
  52.     localdir=`pwd`
  53.     localfiles=`ls $localdir/.menu`
  54.  
  55.     if [ $localfiles ]
  56.      then
  57.          sh -c "/usr/demos/Demo_Interfaces/Buttonfly/buttonfly"
  58.      else
  59.          cd /usr/demos/Demo_Interfaces/Buttonfly
  60.          sh -c "/usr/demos/Demo_Interfaces/Buttonfly/buttonfly"
  61.      fi
  62.   fi
  63.  
  64.